import {Collapse, Form, Row, Col, Input, Select} from 'antd'
import React, {useState, useEffect, memo} from 'react'
import {connect} from 'umi'
import moment from 'moment'
import styles from './index.less'
import {
	carStatus,
	operationType,
	licenseProperty,
	carType,
	isGasCylinderCar,
	registerStatus,
	supportDidiBusiness,
	carHailingDidiAuditStatus,
	examineStatus,
	carHailingStatus,
	isOperationType,
	warehouseType,
} from '../../../dict'
import {getOperationInfo, getDictInfo} from '@/service/carMessage/list'
import {getDict} from '@/service/common/dict'
import UploadAvatar from '@/components/UploadAvatar'
import CustomTable from '@/components/Table'
import { getImageUrlList, IImageItemParams } from '@/utils/image'

import 'moment/locale/zh-cn'

const {TextArea} = Input
const {Panel} = Collapse
const customizeHeader = (value: string) => (
	<div>
		<div className={styles.tip} />
		{value}
	</div>
)

// 全局定义所有车辆证照相关的图片与后端约定好的index。不可前端做修改需保证与后端一致
const ImeagTargetAttrIndex = {
	carFront: 5, // 车辆前
	carBehind: 6, // 车辆后
	carLeft: 7, // 车辆左
	carRight: 8, // 车辆右
	invoice: 1, // 发票
	certificate: 0, // 合格证
}

const licenceEdit = memo((props: {data: any; user: any}) => {
	const {id, detail} = props.data
	const [type, setType] = useState<any>()
	const [form] = Form.useForm<any>()
	// const [seatMaterialList, setSeatMaterialList] = useState<any>([])
	const [useCharacterList, setUseCharacterList] = useState<any>([])
	const [fileList, setFileList] = useState<any>([])
	const [dict, setDict] = useState({
		star_rating: [],
	})
	form.setFieldsValue({
		...detail,
		operationType: detail?.extend?.operationType,
		departureTime: detail?.extend?.departureTime,
		carBrandSeries: detail?.carCertificate?.carBrandSeries,
		carPrepareNo: detail?.extend?.carPrepareNo,
		firstDepartureTime: detail?.extend?.firstDepartureTime,
		starRating: detail?.extend?.starRating,
		photoUpdateTime: detail?.extend?.photoUpdateTime,
		certInvLastUpdateTime: detail?.certInvLastUpdateTime,
		warehouseName: detail?.extend?.warehouseName,
		holderName: detail?.extend?.holderName,
		companyName: detail?.extend?.companyName,
		cityName: detail?.extend?.cityName,
		warehouseType: detail?.extend?.warehouseType,
		registerStatus: detail?.extend?.registerStatus,
		supportDidiBusiness: detail?.extend?.supportDidiBusiness,
		carHailingStatus: detail?.extend?.carHailingStatus,
		carType: detail?.carFashion?.carType, // 车体类型
		category: detail?.carFashion?.category,
		displacement: detail?.carFashion?.displacement,
		wheelbase: detail?.carFashion?.wheelbase,
		length: detail?.carFashion?.length,
		width: detail?.carFashion?.width,
		height: detail?.carFashion?.height,
		fullName: detail?.carFashion?.fullName,
	})
	// 初始化-图片链接列表
	const getFileList = (imageList: Array<IImageItemParams>) => {
		const list = getImageUrlList(imageList);
		setFileList(list);
	}

	// 列表
	const [tableList, setTableList] = useState<any[]>([])
	const [tableOperationList, setTableOperationList] = useState<any[]>([])
	const [operationDetail, setOperationDetail] = useState<any>()
	useEffect(() => {
		setTableList(() => [
			{
				supplyName: detail?.extend?.supplyName,
				biddingNo: detail?.extend?.biddingNo,
				purchaseNo: detail?.extend?.purchaseNo,
				contractNo: detail?.extend?.contractNo,
			},
		])
	}, [props?.user?.orgId, detail])

	const columns: any = [
		{
			title: '供应商',
			dataIndex: 'supplyName',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '招标编号',
			dataIndex: 'biddingNo',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '采购申请单号',
			dataIndex: 'purchaseNo',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		// {
		//   title: '采购计划单号',
		//   dataIndex: 'purchaseNo',
		//   align: 'center',
		//   width: 140,
		//   render: (text: string) => <span>{text || '--'}</span>,
		// },
		{
			title: '合同编号',
			dataIndex: 'contractNo',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
	]
	const operationColumns: any = [
		{
			title: '子协议编号',
			dataIndex: 'subAgreementNo',
			align: 'center',
			width: 200,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '子协议名称',
			dataIndex: 'subAgreementName',
			align: 'center',
			width: 140,
			render: (text: string) => <span>{text || '--'}</span>,
		},
		{
			title: '子协议有效期',
			dataIndex: 'subAgreementBeginTime',
			align: 'center',
			width: 140,
			render: (text: string, record: any) => (
				<span>
					{record?.subAgreementBeginTime}-
					{record?.subAgreementEndTime}
				</span>
			),
		},
		// {
		//   title: '子协议扫描件',
		//   dataIndex: 'vin',
		//   align: 'center',
		//   width: 140,
		//   render: (text: string) => <span>{text || '--'}</span>,
		// },
	]

	// 获取代运营信息
	const getOperation = () => {
		getOperationInfo({carId: id}).then((res: any) => {
			if (res?.success) {
				setTableOperationList(() => res?.data?.subList)
				setOperationDetail(() => res?.data?.main)
			}
		})
	}

	useEffect(() => {
		setType(() => detail?.extend?.operationType)
		if (detail?.extend?.operationType === 2) {
			getOperation()
		}
	}, [props?.user?.orgId, detail])

	// const getDictInfoSeatMaterialFun = () => {
	// 	getDictInfo({type: 'seatMaterial'}).then((res: any) => {
	// 		if (res?.success) {
	// 			setSeatMaterialList(() => res?.data)
	// 		}
	// 	})
	// }

	const getDictInfoUseCharacterFun = () => {
		getDictInfo({type: 'useCharacter'}).then((res: any) => {
			if (res?.success) {
				setUseCharacterList(() => res?.data)
			}
		})
	}
	useEffect(() => {
		getFileList([
			{
				id: detail?.carFront,
				targetAttr: ImeagTargetAttrIndex.carFront,
				name: '车辆前',
			},
			{
				id: detail?.carBehind,
				targetAttr: ImeagTargetAttrIndex.carBehind,
				name: '车辆后',
			},
			{
				id: detail?.carLeft,
				targetAttr: ImeagTargetAttrIndex.carLeft,
				name: '车辆左',
			},
			{
				id: detail?.carRight,
				targetAttr: ImeagTargetAttrIndex.carRight,
				name: '车辆右',
			},
			{
				id: detail?.invoice,
				targetAttr: ImeagTargetAttrIndex.invoice,
				name: '发票',
			},
			{
				id: detail?.certificate,
				targetAttr: ImeagTargetAttrIndex.certificate,
				name: '合格证',
			},
		])
	}, [detail])

	useEffect(() => {
		getDictInfoUseCharacterFun()
		getDict(
			{
				dictKeys: ['star_rating'],
			},
			(res: any) => {
				setDict(() => res)
			},
		)
	}, [])

	// 前
	const carFrontUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.carFront,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				carFront: res?.file?.response?.data?.id,
				photoUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}
	// 后
	const carBehindUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.carBehind,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				carBehind: res?.file?.response?.data?.id,
				photoUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}
	// 左
	const carLeftUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.carLeft,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				carLeft: res?.file?.response?.data?.id,
				photoUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}
	// 右
	const carRightUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.carRight,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				carRight: res?.file?.response?.data?.id,
				photoUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}

	// 发票
	const invoiceUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.invoice,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				invoice: res?.file?.response?.data?.id,
				certInvLastUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}

	// 合格证
	const certificateUploadProps = {
		text: '添加文件',
		modelName: 'CARLIST_FJ',
		accept: 'image/jpeg,image/png',
		targetAttr: ImeagTargetAttrIndex.certificate,
		list: fileList,
		moreNum: 1,
		callback: (res: any) => {
			form.setFieldsValue({
				certificate: res?.file?.response?.data?.id,
				certInvLastUpdateTime: moment().format('YYYY-MM-DD HH:mm:ss'),
			})
		},
	}
	return (
		<div className={styles.admittanceAdd}>
			<div className={`${styles.content} ${styles.formDetils}`}>
				<Form
					form={form}
					name="basic"
					layout="horizontal"
					labelCol={{flex: '200px'}}
					labelAlign="right"
					labelWrap
					initialValues={{remember: true}}
					autoComplete="off"
					disabled>
					<Collapse
						defaultActiveKey={['1']}
						ghost
						expandIconPosition="end">
						<Panel header={customizeHeader('车辆基础信息')} key="1">
							<Row gutter={12}>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆状态"
										name="carStatus">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...carStatus]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="运营分类"
										name="operationType">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...operationType]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="发车日期"
										name="departureTime">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车辆ID" name="carId">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车架号" name="vin">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="品牌车系车型"
										name="fullName">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车牌号" name="number">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车牌性质"
										name="numberType">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...licenseProperty]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="发动机号"
										name="engineNumber">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车辆颜色" name="colorStr">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车辆类型" name="type">
										<Select
											placeholder="请选择"
											notFoundContent="暂无数据"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...carType]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="生产日期"
										name="productionTime"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="质保到期日期"
										name="qaExpireDate"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="座椅材质"
										name="seatMaterialStr"
										rules={[{required: true}]}>
										{/* <Select
											placeholder="请选择"
											fieldNames={{
												value: 'value',
												label: 'valueName',
											}}
											options={[...seatMaterialList]}
										/> */}
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="内饰颜色"
										name="interiorColorStr"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="购置税"
										name="purchaseTax"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="备车流程编号"
										name="carPrepareId">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="采购价格"
										name="purchasePrice"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="首次发车时间"
										name="firstDepartureTime"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="是否气瓶车辆"
										name="isGasCylinderCar"
										rules={[{required: true}]}>
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...isGasCylinderCar]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="气瓶检到期日期"
										name="gasExpirationTime"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="当前里程数"
										name="currentDistance"
										rules={[{required: true}]}>
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆星级"
										name="starRating"
										rules={[{required: true}]}>
										<Select
											disabled
											placeholder="请选择"
											fieldNames={{
												value: 'dictKey',
												label: 'dictValue',
											}}
											options={[...dict.star_rating]}
										/>
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} />
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆前"
										name="carFront"
										rules={[{required: true}]}>
										<UploadAvatar
											{...carFrontUploadProps}
										/>
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆后"
										name="carBehind"
										rules={[{required: true}]}>
										<UploadAvatar
											{...carBehindUploadProps}
										/>
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆照片最近更新时间"
										name="photoUpdateTime">
										<Input placeholder="请输入" disabled />
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} />
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆左"
										name="carLeft"
										rules={[{required: true}]}>
										<UploadAvatar {...carLeftUploadProps} />
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆右"
										name="carRight"
										rules={[{required: true}]}>
										<UploadAvatar
											{...carRightUploadProps}
										/>
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>
								<Col sm={{span: 24}} />
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="发票"
										name="invoice"
										rules={[{required: true}]}>
										<UploadAvatar {...invoiceUploadProps} />
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="合格证"
										name="certificate"
										rules={[{required: true}]}>
										<UploadAvatar
											{...certificateUploadProps}
										/>
										<Input placeholder="请输入" hidden />
									</Form.Item>
								</Col>

								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="合格证/发票最近更新时间"
										name="certInvLastUpdateTime"
										rules={[{required: true}]}>
										<Input placeholder="请输入" disabled />
									</Form.Item>
								</Col>
							</Row>
						</Panel>
						<Panel header={customizeHeader('车辆仓库信息')} key="2">
							<Row gutter={12}>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="验车入库时间"
										name="checkTime">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="最晚验车入库时间"
										name="lastCheckTime">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="到期日"
										name="carExpirationTime">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="入库里程数"
										name="stockInDistance">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="仓库类型"
										name="warehouseType">
										<Select
											disabled
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...warehouseType]}
										/>
									</Form.Item>
								</Col>

								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="仓库名称"
										name="warehouseName">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
							</Row>
						</Panel>
						<Panel header={customizeHeader('业务信息')} key="3">
							<Row gutter={12}>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="持有方" name="holderName">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="所属公司"
										name="companyName">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="所有人" name="owner">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="城市" name="cityName">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="使用性质"
										name="useCharacter">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'value',
												label: 'valueName',
											}}
											options={[...useCharacterList]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="是否自营"
										name="operationType">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...isOperationType]}
										/>
									</Form.Item>
								</Col>
							</Row>
						</Panel>
						<Panel header={customizeHeader('滴滴业务信息')} key="4">
							<Row gutter={12}>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="车辆注册状态"
										name="registerStatus">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...registerStatus]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="快车审核状态"
										name="auditStateExpress">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...examineStatus]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="快车审核不通过原因"
										name="auditReasonExpress">
										<TextArea
											maxLength={200}
											placeholder="请输入（最多200个字）"
											autoSize={{minRows: 3, maxRows: 6}}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="支持滴滴业务"
										name="supportDidiBusiness">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...supportDidiBusiness]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="专车审核状态"
										name="auditStateTailored">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...examineStatus]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="专车审核不通过原因"
										name="auditReasonTailored">
										<TextArea
											maxLength={200}
											placeholder="请输入（最多200个字）"
											autoSize={{minRows: 3, maxRows: 6}}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="网约车证审核状态"
										name="carHailingLicAuditStatus">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...examineStatus]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="网约车运输证审核失败原因"
										name="carHailingLicAuditReason">
										<TextArea
											maxLength={200}
											placeholder="请输入（最多200个字）"
											autoSize={{minRows: 3, maxRows: 6}}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="滴滴车证是否验真"
										name="carHailingDidiAuditStatus">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[
												...carHailingDidiAuditStatus,
											]}
										/>
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="网约车证完成状态"
										name="carHailingStatus">
										<Select
											placeholder="请选择"
											fieldNames={{
												value: 'key',
												label: 'label',
											}}
											options={[...carHailingStatus]}
										/>
									</Form.Item>
								</Col>
							</Row>
						</Panel>
						<Panel header={customizeHeader('车型车款信息')} key="5">
							<Row gutter={12}>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车体类型" name="carType">
										<Input placeholder="--" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item
										label="发动机排量"
										name="displacement">
										<Input placeholder="--" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="轴距" name="wheelbase">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车身长度" name="length">
										<Input placeholder="请输入" />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车身宽度" name="width">
										<Input placeholder="请输入" disabled />
									</Form.Item>
								</Col>
								<Col
									sm={{span: 24}}
									md={{span: 12}}
									lg={{span: 8}}>
									<Form.Item label="车身高度" name="height">
										<Input placeholder="请输入" disabled />
									</Form.Item>
								</Col>
							</Row>
						</Panel>
						{type === 1 ? (
							<>
								<Panel
									header={customizeHeader('供应商信息')}
									key="6">
									<CustomTable
										columns={columns}
										pagination={false}
										dataSource={tableList}
									/>
								</Panel>
							</>
						) : (
							<>
								<Panel
									header={customizeHeader('代运营信息')}
									key="6">
									<>
										<Row gutter={12}>
											<Col
												sm={{span: 24}}
												md={{span: 12}}
												lg={{span: 8}}>
												<Form.Item
													label="协议编号"
													name="agreementNo">
													{
														operationDetail?.agreementNo
													}
												</Form.Item>
											</Col>
											<Col
												sm={{span: 24}}
												md={{span: 12}}
												lg={{span: 8}}>
												<Form.Item
													label="资产运营方"
													name="operatorStr">
													{
														operationDetail?.operatorStr
													}
												</Form.Item>
											</Col>
											<Col
												sm={{span: 24}}
												md={{span: 12}}
												lg={{span: 8}}>
												<Form.Item
													label="协议有效期"
													name="beginTime">
													{operationDetail?.beginTime}{' '}
													-{operationDetail?.endTime}
												</Form.Item>
											</Col>
											{/* <Col sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 8 }}>
                        <Form.Item label="代运营周期" name="carFashion.length">
                          {operationDetail?.endTime}
                        </Form.Item>
                      </Col> */}
											{/* <Col sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 8 }}>
                        <Form.Item label="协议扫描件" name="carFashion.width">
                          <Input placeholder="请输入" disabled />
                        </Form.Item>
                      </Col> */}
										</Row>
										<CustomTable
											columns={operationColumns}
											pagination={false}
											dataSource={tableOperationList}
										/>
									</>
								</Panel>
							</>
						)}
					</Collapse>
				</Form>
			</div>
		</div>
	)
})
export default connect(({user}: any) => ({user}))(licenceEdit)
